From 0f139af4f7263dcdd3c437475fea9fb25d9d85c0 Mon Sep 17 00:00:00 2001 From: robertl Date: Thu, 3 Aug 2006 20:41:58 +0000 Subject: [PATCH] Zero struct tm on timestamp read so if time tag is malformed, we don't have hour number 17347896 or whatever else happened to be there. --- gpx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gpx.c b/gpx.c index b6bbdfe13..07f3ecdd6 100644 --- a/gpx.c +++ b/gpx.c @@ -735,6 +735,8 @@ xml_parse_time( const char *cdatastr ) struct tm tm; time_t rv = 0; char *timestr = xstrdup( cdatastr ); + + memset(&tm, 0, sizeof(tm)); offsetstr = strchr( timestr, 'Z' ); if ( offsetstr ) { -- 2.30.2